//
//  ChatMessageManageCell.m
//  Btpin
//
//  Created by Vic on 2020/3/22.
//  Copyright © 2020 Vic. All rights reserved.
//

#import "ChatMessageManageCell.h"

@interface ChatMessageManageCell ()
{
    UILabel *textLbl;
    UIButton *editBtn;
}
@end

@implementation ChatMessageManageCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self initUI];
    }
    return self;
}
- (void)initUI {
    textLbl = [UIToolsControl initLabelWithFrame:CGRectMake(LeftSpace, 0, WIDTH-90, 60) text:nil textColor:THEMECOLOR_OF_TEXT_666666 font:Font_16];
    textLbl.numberOfLines = 2;
    textLbl.lineBreakMode= NSLineBreakByWordWrapping;
    [self.contentView addSubview:textLbl];
    
    
    editBtn = [UIToolsControl initButtonWithFrame:CGRectMake(EndY(textLbl)+10, 0, 40, 60) imageName:@"" target:self action:@selector(editBtnTap) title:nil titleColor:nil];
    [self.contentView addSubview:editBtn];
}
- (void)editBtnTap {
    if (self.delegate && [self.delegate respondsToSelector:@selector(chatMessageManageCellEditTap:)]) {
        [self.delegate chatMessageManageCellEditTap:editBtn.indexPath];
    }
}
- (void)reloadDataForModel:(ChatSentenceModel *)model indexPath:(NSIndexPath *)indexPath {
    editBtn.indexPath = indexPath;
    textLbl.text = model.text;
}

- (void)awakeFromNib {
    [super awakeFromNib];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}

@end
